public class Strings
{
	public static void main(String[] args)
	{
		// String concatenation
		String school = "Harding "; 
		school = school + "University";   // school is "Harding University"

		// String comparison
		String mascot = "Bisons"; 
		if (mascot == "Bisons")    // Not the correct way to do string comparisons
		if (mascot.equals("Bisons"))   // true
		if (mascot.equalsIgnoreCase("BISONS"))   // true
		if (mascot.compareTo("Bisons") == 0)   // true

		System.out.println(mascot.substring(2, 5));   // Prints "son"

		// My birthday: Oct 12, 1973
		java.util.Calendar c = new java.util.GregorianCalendar(1973, 10, 12);
		String s = String.format("My birthday: %1$tb %1$te, %1$tY", c);

		// Mutable string 
		StringBuffer buffer = new StringBuffer("two "); 
		buffer.append("three "); 
		buffer.insert(0, "one "); 
		buffer.replace(4, 7, "TWO"); 
		System.out.println(buffer);     // Prints "one TWO three"
	}
}